package com.juyu.miliao.common.domain;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;

/**
 * @author jh
 * 2018/9/5
 */
public class NetEaseConfig {

    private static String appKey;

    private static String appSecret;

    public static String getAppSecret() {
        return appSecret;
    }

    @Value("${app.netease.appSecret}")
    public void setAppSecret(String appSecret) {
        if (StringUtils.isEmpty(appSecret)) {
            throw new RuntimeException("config can not be null");
        }
        NetEaseConfig.appSecret = appSecret;
    }

    public static String getAppKey() {
        return appKey;
    }

    @Value("${app.netease.appKey}")
    public void setAppKey(String appKey) {
        if (StringUtils.isEmpty(appKey)) {
            throw new RuntimeException("config can not be null");
        }
        NetEaseConfig.appKey = appKey;
    }
}
